package com.wing.productionPlan.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wing.common.utils.JsonResult;
import com.wing.common.utils.PageResult;
import com.wing.productionPlan.model.entity.SimpleWorkOrder;
import com.wing.productionPlan.model.request.ProductionProcessMaterialForm;
import com.wing.productionPlan.model.request.SimpleWorkOrderForm;
import com.wing.productionPlan.model.response.ProductionProcessMaterialVO;
import com.wing.productionPlan.model.response.SimpleWorkOrderProcessVO;
import com.wing.productionPlan.model.response.SimpleWorkOrderVO;
import com.wing.productionPlan.model.response.UnstartedMaterialsVO;
import com.wing.web.excel.DeviceExcelIn;
import com.wing.web.excel.WorkOrderExcelIn;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 简版工单表-Service
 *
 * @author
 */
public interface SimpleWorkOrderService extends IService<SimpleWorkOrder> {

    /**
     * 添加
     *
     * @param simpleWorkOrderForm
     * @return
     */
    int add(SimpleWorkOrderForm simpleWorkOrderForm);

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<SimpleWorkOrderVO> list4app(Map<String, Object> params);

    /**
     * 分页list-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    Page<SimpleWorkOrderVO> pageList4app(Page page, Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    SimpleWorkOrderVO get4appById(Long id);

    /**
     * 德昌柜子面板添加简版工单
     * @param simpleWorkOrderForm
     */
    void submitWorkOrder(SimpleWorkOrderForm simpleWorkOrderForm);

    /**
     * 后台添加简版工单
     * @param simpleWorkOrderForm
     */
    void addSimpleWorkOrder(SimpleWorkOrderForm simpleWorkOrderForm);

    SimpleWorkOrderVO getSimpleWorkOrderVODetails(Long id);

    SimpleWorkOrderProcessVO getWorkOrderDeviceAndMaterial(Long processId,Long workOrderId);

    /**
     * 后台新的添加简版工单
     * @param simpleWorkOrderForm
     */
    void addNewSimpleWorkOrder(SimpleWorkOrderForm simpleWorkOrderForm);
    /**
     * 修改简版工单
     * @param simpleWorkOrderForm
     */
    void updateWorkOrder(SimpleWorkOrderForm simpleWorkOrderForm);

    /**
     * 作废工单下的工序
     * @param id
     */
    void cancellationWorkOrderProcess(Long id);

    /**
     * 作废工单下的设备
     * @param id
     */
    void cancellationWorkOrderDevice(Long id);
    /**
     * 作废工单下的物料
     * @param id
     */
    void cancellationWorkOrderMaterial(Long id);

    JsonResult<List<SimpleWorkOrderProcessVO>> getMaterialForecastData(String skuCode,Integer productionQuantity);

    void importExcel(List<WorkOrderExcelIn> list);

    JsonResult topData();


    PageResult<UnstartedMaterialsVO> listUnstartedMaterials(Integer page, Integer limit, Map<String, Object> params);

    List<UnstartedMaterialsVO> exportUnstartedMaterials(Map<String, Object> params);

    Page<SimpleWorkOrderVO> listOrder(Page page, Map<String, Object> params);

    JsonResult cancel(Long id);
}
